import React, { Component } from 'react';
import { Card, Spin } from 'antd';
import { connect } from 'dva';
import PageHeaderLayout from '@/components/PageHeaderWrapper';

let reqApi = '';

class page extends Component {
  state = {
    loading: false,
  };

  componentDidMount() {
    console.clear();
    reqApi = 'homePage';
    this.funcGetHomeData();
    window.onresize = () => this.setState({});
  }

  componentWillUnmount() {
    window.onresize = null;
  }

  // 获取首页数据
  funcGetHomeData = () => {
    // this.setState({ loading: true });
    // const { props } = this;
    // props.dispatch({
    //   type: reqApi + '/home',
    //   payload: {},
    // }).then(() => this.setState({ loading: false }));
  };

  render() {
    const { state } = this;
    // const { homeData } = props[reqApi];

    return (
      <PageHeaderLayout hiddenBreadcrumb title="首页">
        <Spin spinning={state.loading} size="large">
          <Card bordered={false} />
        </Spin>
      </PageHeaderLayout>
    );
  }
}

export default connect(({ homePage }) => ({ homePage }))(page);
